function EventStorage() {

  var eventStorage = {};

  function add(target, event, handle) {
    
    // TODO: support anonymous function
    if (!eventStorage[event]) {
      eventStorage[event] = {};
    }

    handle.name && (eventStorage[event][handle.name] = handle);
    target.addEventListener(event, handle);
  
  }

  function remove(target, event, handleName) {

    if (!eventStorage[event]) {
      
      throw new Error('no event about' + event);
      return;

    } else {
      target.removeEventListener(event, eventStorage[event][handleName]);
    }
  
  }

  function removeAll(target, event) {
    for (handleName in eventStorage[event]) {
      target.removeEventListener(event, eventStorage[event][handleName]);
    }
  }
  
  return {
    add: add,
    remove: remove,
    removeAll: removeAll
  }
}

EventStorage = EventStorage();